<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>酒店详情页面</title>
    <link rel="stylesheet" href="details.css">
    <script src="jquery-3.6.0.min.js"></script>
    <link href="../../../css/Untils/public.css" rel="stylesheet">
    <script src="//unpkg.com/vue@2/dist/vue.js"></script>
    <script src="//unpkg.com/element-ui@2.15.10/lib/index.js"></script>
   
</head>

<body>
    <div id="app">
        <!--面包屑-->
        <div class="padding-box crumbs">
            <el-breadcrumb separator="/">
                <el-breadcrumb-item>
                    <a href="../../index/index.html" class="href" v-if="admin == undefined">首页</a>
                    <a :href=aHref class="href" v-if="admin != undefined">首页</a>
                </el-breadcrumb-item>
                <el-breadcrumb-item>
                    <a href="../screen.html" v-if="admin == undefined" class="href">酒店筛选页</a>
                    <a :href=aHref1 v-if="admin != undefined" class="href">酒店筛选页</a>
                </el-breadcrumb-item>
                <el-breadcrumb-item>
                    <!-- vue 插槽进行渲染 -->
                    {{hotel_info.hotelName}}
                </el-breadcrumb-item>
            </el-breadcrumb>
        </div>
        <!-- 画布 -->
        <div class="details-box padding-box">
            <!-- 酒店名 -->
            <div class="hotel-header">
                <!-- 酒店基本信息 -->
                <div class="hotel-header-text">
                    <div class="hotel-header-1">
                        <!-- 标题 -->
                        <label>{{hotel_info.hotelName}}</label>
                    </div>
                    <div class="hotel-header-2">
                        <!-- 评分 -->
                        <p>
                            <span>{{hotelScore}}</span>
                            <span>/5</span>
                        </p>
                        <!-- 查看评论 -->
                        <div class="collection">
                            <a href="#jumpComment" class="select-collection">
                                <label>查看</label>
                                <label class="collection-num">{{commentsList.length}}</label>
                                <label>条数据></label>
                            </a>
                        </div>
                        <!-- 收藏 -->
                        <div class="comment" @click="clickCollection()" v-if="count1 == 0" >
                            <a href="javascript:void(0)" style="border: 1px solid #efefef;">
                                <i class="comment-img"></i>
                                <span>收藏</span>
                            </a>
                        </div>
                        <div class="comment" @click="clickCollection()" v-if="count1 == 1" >
                            <a href="javascript:void(0)" style="border: 1px solid #4db46a;">
                                <i class="comment-img2"></i>
                                <span>收藏</span>
                            </a>
                        </div>
                    </div>
                </div>
                <!-- 百度地图api -->
                <a href="../../../Public_Html/Map/MaoAPI_baidu.html" class="baidu-api">

                </a>
            </div>
            <div class="date-box">
                <div class="block">
                    <el-date-picker
                        style="border-top: none;border-bottom: none;border-radius: 0;margin-bottom: 2px;border: none;"
                        v-model="mydate" type="daterange" range-separator="至"
                        start-placeholder="入住日期" end-placeholder="退房日期"
                        value-format="yyyy-MM-dd">
                    </el-date-picker>
                    <el-button type="primary" icon="el-icon-search" @click="getDate(hotel_id)" style="background-color: #4db46a;border:1px solid #4db46a">搜索</el-button>
                </div>
            </div>
            <!-- 房间详情列表 -->
            <div class="hotel-details">

                <div class="room-type" v-for="(room,i) in hotel_information">
                    <!-- 房间图片 -->
                    <img class="room-img" src="images/hotel-1.jpg"></img>
                    <!-- 房间信息模块 -->
                    <div class="room-information-all">
                        <div class="room-information">
                            <label class="room-1">{{room.roomType}}</label>
                            <span>
                                <label class="room-live">可入住{{room.standby01}}人</label>
                            </span>
                            <label class="room-3">
                                <p class="room-3-row">
                                    <i class="room-3-1"></i>
                                    <label class="room-3-2">25-30m²</label>
                                </p>
                                <p class="room-3-row">
                                    <i class="room-3-1" style="background-image: url(images/window-14px.svg);"></i>
                                    <label class="room-3-2">有窗户</label>
                                </p>
                                <p class="room-3-row">
                                    <i class="room-3-1" style="background-image: url(images/stairs-14px.svg);"></i>
                                    <label class="room-3-2">2-5层</label>
                                </p>
                            </label>
                            <label class="room-4">
                                <label class="room-4-1">超值价</label>
                                <p class="room-4-2">
                                    <label class="room-4-2-1">￥</label>
                                    <label class="room-4-2-1">{{room.roomLeastPrice}}</label>
                                </p>
                            </label>
                            <div class="room-5" @click="orderBtn(room,i)" v-if="room.roomLeftNum != 0">
                                <p class="room-5-1">
                                    <label>剩余{{room.roomLeftNum}}间</label>
                                </p>
                                <label class="room-5-2">
                                    在线付
                                </label>
                            </div>
                            <div class="room-5-0" v-if="room.roomLeftNum == 0" style="background-color: #b4b8bc;">
                                <p class="room-5-1" style="background-color: #b4b8bc; border: 1px solid #b4b8bc">
                                    <label>剩余0间</label>
                                </p>
                                <label class="room-5-2" style="background-color: #b4b8bc; border: 1px solid #b4b8bc;color: white;border-top: 1px solid white;">
                                    房间已满
                                </label>
                            </div>
                        </div>
                    </div>
                </div>
    
            </div>
            <!-- 酒店信息模块 -->
            <div class="hotel-information">
                <label class="hotel-information-1">酒店信息</label>
                <p class="hotel-information-2">
                    酒店信息
                </p>
                <label class="hotel-information-3">酒店电话:+123456</label>
            </div>
            <!-- 服务设施模块 -->
            <div class="hotel-service">
                <label class="hotel-information-1">服务设施</label>
                <div class="hotel-service-1">
                    <label class="hotel-service-1-1">娱乐与健身设施</label>
                    <label class="hotel-service-1-2">
                        <label class="hotel-service-1-2-1">日光浴场</label>
                        <label class="hotel-service-1-2-1">浮潜</label>
                        <label class="hotel-service-1-2-1">健身房</label>
                        <label class="hotel-service-1-2-1">钓鱼</label>
                        <label class="hotel-service-1-2-1">游戏室</label>
                        <label class="hotel-service-1-2-1">潜水</label>
                        <label class="hotel-service-1-2-1">沙滩排球</label>
                        <label class="hotel-service-1-2-1">烧烤</label>
                        <label class="hotel-service-1-2-1">桌球室</label>
                    </label>
                </div>
                <div class="hotel-service-1">
                    <label class="hotel-service-1-1">娱乐与健身设施</label>
                    <label class="hotel-service-1-2">
                        <label class="hotel-service-1-2-1">日光浴场</label>
                        <label class="hotel-service-1-2-1">浮潜</label>
                        <label class="hotel-service-1-2-1">健身房</label>
                        <label class="hotel-service-1-2-1">钓鱼</label>
                        <label class="hotel-service-1-2-1">游戏室</label>
                        <label class="hotel-service-1-2-1">潜水</label>
                        <label class="hotel-service-1-2-1">沙滩排球</label>
                        <label class="hotel-service-1-2-1">烧烤</label>
                        <label class="hotel-service-1-2-1">桌球室</label>
                    </label>
                </div>
                <div class="hotel-service-1">
                    <label class="hotel-service-1-1">娱乐与健身设施</label>
                    <label class="hotel-service-1-2">
                        <label class="hotel-service-1-2-1">日光浴场</label>
                        <label class="hotel-service-1-2-1">浮潜</label>
                        <label class="hotel-service-1-2-1">健身房</label>
                        <label class="hotel-service-1-2-1">钓鱼</label>
                        <label class="hotel-service-1-2-1">游戏室</label>
                        <label class="hotel-service-1-2-1">潜水</label>
                        <label class="hotel-service-1-2-1">沙滩排球</label>
                        <label class="hotel-service-1-2-1">烧烤</label>
                        <label class="hotel-service-1-2-1">桌球室</label>
                    </label>
                </div>
            </div>
            <!-- 入住须知模块 -->
            <div class="hotel-notice">
                <label class="hotel-information-1 hot-notice-1">入住须知</label>
                <div class="hotel-service-1">
                    <label class="hotel-service-1-1">入离时间</label>
                    <label class="hotel-service-1-2 hotel-notice-1-1">
                        入住时间：15:00以后 离店时间：12:00以前
                    </label>
                </div>

                <div class="hotel-service-1">
                    <label class="hotel-service-1-1">宠物政策</label>
                    <label class="hotel-service-1-2 hotel-notice-1-1">
                        不可携带宠物
                    </label>
                </div>

                <div class="hotel-service-1">
                    <label class="hotel-service-1-1">酒店提示</label>
                    <label class="hotel-service-1-2 hotel-notice-1-1">
                        1、根据防疫部门通知，防疫期间，中高风险地区旅居史人员需隔离，低风险地区旅居史人员需持48小时核酸，疫情接待政策受各地疫情变化影响，请在下单前与酒店确认接待政策，以免影响您的入住。2、参照新冠病毒疫情防控工作要求，保障宾客和工作人员的健康与安全，酒店各场所营业时间调整如下：健身中心、SPA水疗馆、锦湾酒吧、啦啦吧、儿童乐园、水桶王国主题餐厅、每日康乐活动及夏令营活动，全部暂停服务，直至另行通知。3、根据三亚市防疫政策要求：疫情期间，14天内无中高风险地区和涉疫区轨迹人员持健康绿码或国务院健康绿码抵市。防疫政策可能会随时间变更，获取三亚防疫政策请拨打“12345〞
                        政府服务热线。
                    </label>
                </div>

            </div>
            <!-- 用户点评模块 -->
            <div class="user-comment">
                <div class="user-comment-1">
                    <label class="user-comment-1-1">用户点评</label>
                    <label class="user-comment-1-2">综合评分</label>
                    <label class="user-comment-1-3">
                        <label class="user-comment-1-3-1">{{hotelScore}}</label>
                        <label class="user-comment-1-3-2" v-if="hotelScore <= 2.5">较差!</label>
                        <label class="user-comment-1-3-2" v-if="hotelScore > 2.5 && hotelScore < 4">一般!</label>
                        <label class="user-comment-1-3-2" v-if="hotelScore >= 4">优秀!</label>
                    </label>
                </div>
                <div class="user-comment-2">
                    <!-- 评论选择模块 -->
                    <div class="user-comment-2-1">
                        <a href="javascript:void(0)" name="jumpComment" class="user-comment-2-1-a" @click="clickComments()">
                            <span>全部评论(</span>
                            <span>{{commentsList.length}}</span>
                            <span>)</span>
                        </a>
                    </div>
                    <!-- 评论展示模块 -->
                    <div class="user-comment-2-2">
                        <!-- 评论用户信息模块 -->
                        <div class="user-comment-module" v-for="(userComment,index) in commentsList" ::key="index">
                            <!-- 此div设置展示更多条件 -->
                            <div v-show="index < max">
                                <div class="user-comment-2-2-1">
                                    <!-- 用户头像 -->
                                    <img :src="userComment.userPhoto" style="margin-left: 10px;display: flex;width: 30px;height: 30px;">
                                    <label class="user-comment-2-2-1-1">{{userComment.userName}}</label>
                                    <!-- <label class="user-comment-2-2-1-3">评分:{{userComment.score}}</label> -->
                                    <label class="user-comment-2-2-1-3">
                                        <el-rate
                                            v-model="userComment.score"
                                            disabled
                                            show-score
                                            text-color="#ff9900">
                                        </el-rate>
                                    </label>
                                </div>
                                <!-- 评论区 -->
                                <div class="user-comment-2-2-2">
                                    <span class="user-comment-2-2-2-1" style="color: #18191c;">
                                        {{userComment.text}}
                                    </span>
                                    <ul class="user-comment-2-2-2-2">
                                        <li v-for="(image,j) in userComment.images">
                                            <img :src="image">
                                        </li>
                                    </ul>
                                    <div class="user-comment-2-2-2-3 comment-other">
                                        <!-- 点赞图标 -->
                                        <label class="comment-time">{{userComment.commentTime}}</label>
                                        <label class="user-comment-2-2-1-2 comment-kudos" @click="kudos(index)" v-if="!userComment.hasKudos"></label>
                                        <label class="user-comment-2-2-1-2no comment-kudos" @click="kudos(index)" v-if="userComment.hasKudos"></label>
                                        <label class="comment-kudos-num">{{userComment.kudosNum}}</label>
                                        <a href="javascript:void(0)" class="comment-eply" @click="commentEply(userComment)">回复</a>
                                    </div>
                                    <!-- 评论回复展示 -->
                                    <div class="comment-reply-show">
                                        <div v-for="(commentReply,index1) in showCommentReply" class="comment-reply-show-1" :key="index1">
                                            <div v-show="true">
                                                <div v-if="commentReply.mainComment == userComment.commentId">
                                                    <!-- 单个评论回复div -->
                                                    <div class="comment-reply-show-main">
                                                        <div class="comment-reply-show-main-1">
                                                            <!-- 用户头像 -->
                                                            <div class="comment-reply-photo">
                                                                <img :src="commentReply.user2Photo" style="height:30px;width: 30px;">
                                                            </div>
                                                            <div class="comment-supply">
                                                                <!-- 用户名 -->
                                                                <div class="comment-reply-userName">{{commentReply.user2UserName}}</div>
                                                                <!-- 评论回复内容 -->
                                                                <div class="comment-reply-text">
                                                                    {{commentReply.commentText}}
                                                                </div>
                                                            </div>
                                                        </div>
                                                        <div class="comment-reply-show-main-2">
                                                            <div class="comment-reply-time">{{commentReply.commentTime}}</div>
                                                            <a href="javascript:void(0)" class="comment-eply" @click="commentEply1(commentReply)">回复</a>
                                                        </div>
                                                        <!-- 评论回复框2.0 回复已经发布回复 -->
                                                        <div :class="['commentId',commentReply.commentReplyId]" style="display: none;margin-top: 10px;margin-bottom: -20px;" >
                                                            <div class="comment-eply-element">
                                                                <div id="app1" class="app1">
                                                                    <el-input
                                                                    type="textarea"
                                                                    :autosize="{ minRows: 3, maxRows: 3}"
                                                                    :placeholder="'回复 @'+commentReply.user2UserName+':'"
                                                                    v-model="textarea2" style="height: 80%;">
                                                                    </el-input>
                                                                </div>
                                                                <div id="app2" class="app2">
                                                                    <el-row class="element-btn-before">
                                                                        <el-button type="primary" class="element-btn1" @click="commentReply1(textarea2)">发布</el-button>
                                                                    </el-row>
                                                                </div>
                                                            </div>
                                                        </div>  
                                                       
                                                    </div>
                                                     
                                                </div>
                                                <!-- 回复已经回复过的用户div -->
                                                <div v-for="(commentReply1,index2) in showCommentReply1" :key="index2">
                                                    <div v-show="true">
                                                        <div v-if="userComment.commentId == commentReply1.mainComment && commentReply1.user1commentReplyId == commentReply.commentReplyId">                 
                                                            <!-- 单个评论回复div -->
                                                            <div class="comment-reply-show-main">
                                                                <div class="comment-reply-show-main-1">
                                                                    <!-- 用户头像 -->
                                                                    <div class="comment-reply-photo">
                                                                        <img :src="commentReply1.user2Photo" style="height:30px;width: 30px;">
                                                                        <!-- {{commentReply1}} -->
                                                                    </div>
                                                                    <div class="comment-supply">
                                                                        <!-- 用户名 -->
                                                                        <div class="comment-reply-userName">{{commentReply1.user2UserName}}</div>
                                                                        <div class="comment-reply-userName1">回复</div>
                                                                        <div class="comment-reply-userName1 comment-reply-userName2">@{{commentReply1.user1UserName}}</div>
                                                                        <!-- 评论回复内容 -->
                                                                        <div class="comment-reply-text">
                                                                            {{commentReply1.commentText}}
                                                                            <!-- {{commentReply1}} -->
                                                                            <!-- 2--{{commentReply1.user1commentReplyId}}<br>
                                                                            3--{{commentReply.commentReplyId}}<br>
                                                                            4--{{userComment.commentId}}<br>
                                                                            5--{{commentReply1.mainComment}}<br> -->
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <div class="comment-reply-show-main-2">
                                                                    <div class="comment-reply-time">{{commentReply1.commentTime}}</div>
                                                                    <!-- <a href="javascript:void(0)" class="comment-eply" @click="commentEply1(commentReply1)">回复</a> -->
                                                                </div>
                                                                <!-- 评论回复框2.0 回复已经发布回复(框中框中框) -->
                                                                <div :class="['commentId',commentReply1.commentReplyId]" style="display: none;margin-top: 10px;margin-bottom: -20px;" >
                                                                    <div class="comment-eply-element">
                                                                        <div id="app1" class="app1">
                                                                            <el-input
                                                                            type="textarea"
                                                                            :autosize="{ minRows: 3, maxRows: 3}"
                                                                            :placeholder="'回复 @'+commentReply1.user1UserName+':'"
                                                                            v-model="textarea2" style="height: 80%;">
                                                                            </el-input>
                                                                        </div>
                                                                        <div id="app2" class="app2">
                                                                            <el-row class="element-btn-before">
                                                                                <el-button type="primary" class="element-btn1" @click="commentReply2(textarea2)">发布</el-button>
                                                                            </el-row>
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                                <!-- 回复已经回复过的用户div -->
                                                                <div v-for="(commentReply2,index3) in showCommentReply2" :key="index3">
                                                                    <div v-show="true">
                                                                        <div v-if="commentReply2.mainComment == userComment.commentId && commentReply1.commentReplyId == commentReply2.commentReplyId">
                                                                            <!-- 单个评论回复div -->
                                                                            <div class="comment-reply-show-main">
                                                                                <div class="comment-reply-show-main-1">
                                                                                    <!-- 用户头像 -->
                                                                                    <div class="comment-reply-photo">
                                                                                        <img :src="commentReply2.user2Photo" style="height:30px;width: 30px;">
                                                                                        <!-- {{commentReply2}} -->
                                                                                    </div>
                                                                                    <div class="comment-supply">
                                                                                        <!-- 用户名 -->
                                                                                        <div class="comment-reply-userName">{{commentReply2.user2UserName}}</div>
                                                                                        <div class="comment-reply-userName1">回复</div>
                                                                                        <div class="comment-reply-userName1 comment-reply-userName2">@{{commentReply2.user1UserName}}</div>
                                                                                        <!-- 评论回复内容 -->
                                                                                        <div class="comment-reply-text">
                                                                                            {{commentReply2.commentText}}<br>
                                                                                        </div>
                                                                                    </div>
                                                                                </div>
                                                                                <div class="comment-reply-show-main-2">
                                                                                    <div class="comment-reply-time">{{commentReply2.commentTime}}</div>
                                                                                    <!-- <a href="javascript:void(0)" class="comment-eply" @click="commentEply1(commentReply1)">回复</a> -->
                                                                                </div>
                                                                            </div>
                                                                        </div> 
                                                                    </div>
                                                                </div> 
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>  
                                            </div>
                                        </div>
                                        <!-- <div class="comment-manage">
                                            <div class="comment-manage-1">
                                                <a href="javascript:void(0)" @click="commentShowMore1()" class="comment-show">共有<label>x</label>条评论 点击查看</a>
                                                <a href="javascript:void(0)" @click="commentShowLess1()" class="comment-show">收起</a>
                                            </div>
                                        </div> -->
                                    </div>
                                    <!-- 评论回复框 -->
                                    <div :class="['commentId',userComment.commentId]" style="display: none;margin-top: 10px;margin-bottom: -20px;" >
                                        <div class="comment-eply-element">
                                            <div id="app1" class="app1">
                                                <el-input
                                                  type="textarea"
                                                  :autosize="{ minRows: 3, maxRows: 3}"
                                                  :placeholder="'回复 @'+userComment.userName+':'"
                                                  v-model="textarea2" style="height: 80%;">
                                                </el-input>
                                            </div>
                                            <div id="app2" class="app2">
                                                <el-row class="element-btn-before">
                                                    <el-button type="primary" class="element-btn1" @click="commentReply(textarea2)">发布</el-button>
                                                </el-row>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="comment-manage">
                            <div class="comment-manage-1">
                                <a href="javascript:void(0)" @click="commentShowMore()" class="comment-show">展示更多</a>
                                <a href="javascript:void(0)" @click="commentShowLess()" class="comment-show">收起</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- 周边酒店模块 -->
            <div class="guess-like" v-if="isShowRecommendHotelList">
                <div class="guess-like-1">
                    周边酒店
                </div>
                <ul class="guess-like-hotel">
                    <li class="guess-like-hotel-li" v-for="item in recommendHotelList">
                        <div class="guess-img">
                            <img :src=item.hotelShowImg
                                class="guess-img-img">
                        </div>
                        <label class="guess-name">{{item.hotelName}}</label>
                        <label class="guess-name-1">评分:{{item.hotelMark}}</label>
                        <div class="guess-money">
                            <label>￥</label>
                            <label>{{item.roomLeastPrice}}</label>
                            <label>起</label>
                        </div>
                    </li>
                </ul>
            </div>
            <!-- websocket弹窗 -->
            <div style="display: none;">
                <!-- websocket弹窗  -->
                <el-button plain @click="open2">
                </el-button>
            </div>
        </div>
    </div>

    <!-- 引用axios -->
    <script src="../details/axios-0.18.0.js"></script>
    <!--引用vue-->
    <script src="../../../js/untils/vue.js"></script>
    <!-- 引入样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <script>
        new Vue({
                el: '#app',
                // 数据
                data() {
                    return {
                        aHref:"../../index/index.html?phone=",
                        aHref1:"../screen.html?phone=",
                        max:5,//最多展示多少评论
                        max1:2,//最多展示多少评论回复
                        max2:1,//评论回复最多多少条
                        admin:"",//筛选页面传过来的参数
                        phone:null,
                        userId:"",
                        hotel_data:0,//酒店信息以及房间信息
                        hotel_id:0,
                        user_id:0,
                        city: '', // 搜索框选择的城市
                        date: '', // 日期
                        roomsList:'',//查询出可以订阅的房间信息
                        mydate:[],
                        isShowForm: false, // 是否展示城市选择框
                        isShowFormXF: false, // 悬浮框的城市选择框
                        count1:0,//收藏js
                        count2:0,//查看评论js
                        isCollection: false, // 是否收藏
                        commentsList:[],//所有评论
                        token:"",//token
                        hotel_information:[],//room_list查询内容
                        hotel_info:"",//酒店基本信息
                        hasKudos: false,
                        textarea2: '',//element-ui评论回复内容
                        oneReplyBox:0,//保持回复框只出现一个
                        commentReplyBoxList:[],//监听所有已经打开回复框的评论
                        //被评论对象
                        commentEplyMongoDB:{
                            commentReplyId:null,
                            user1commentReplyId:null,
                            user1:null,//被评论对象
                            user1UserName:null,
                            user2:null,//发起评论对象
                            user2UserName:null,
                            commentTime:null,
                            commentText:null,
                            user2Photo:null,
                            mainComment:null,//楼主评论id
                        },
                        //展示评论信息
                        showCommentReply:[],
                        //保存评论回复的回复
                        showCommentReply1:[],
                        //回复2.0
                        showCommentReply2:[],
                        //酒店评分
                        hotelScore:0,
                        couponWebsocketMsg:"",//websocket信息
                        //推荐算法
                        isShowRecommendHotelList:false,
                        recommendHotelList:[]
                    }
                },
                // 方法
                methods: {
                    //websocket消息弹窗
                    open2() {
                        console.log("正在执行")
                        this.$notify({
                            title: '您有一条新消息',
                            message: this.couponWebsocketMsg,
                            position: 'bottom-right'
                        });
                        var Ctor = Vue.extend(Main)
                        new Ctor().$mount('#app')
                    },
                    //获得回复的回复 评论回复3.0
                    commentReply2(text){
                        var that = this
                        console.log("评论3.0")
                        this.commentEplyMongoDB.commentText = text
                        console.log(this.commentEplyMongoDB)
                        axios({
                            method:"post",
                            url:"http://localhost:8080/commentReply/saveCommentReply",
                            data:{
                                "commentEplyMongoDB":this.commentEplyMongoDB
                            }
                        }).then(function(resp){
                            if(resp.data === "操作成功"){
                                var url = decodeURI(window.location.href);
                                console.log(url)
                                let str = url.split("?")[1].split("&")
                                let phone = str[0].split("=")[1]
                                let hotelId = str[1].split("=")[1]
                                that.selectAllComment(hotelId)
                                that.getCommentReply2(that.commentEplyMongoDB.user1commentReplyId)
                                that.getReply2(resp.data[i].commentReplyId)
                            }
                        })
                    },
                    //评论回复3.0
                    getCommentReply2(commentReplyId){
                        console.log(commentReplyId)
                        this.showCommentReply2 = []
                        var that = this
                        axios({
                            method:"get",
                            url:"http://localhost:8080/commentReply/getCommentReplyBig/"+commentReplyId
                        }).then(function(resp){
                            that.showCommentReply2 = []
                            console.log("读取3.0中...")
                            for(let i = 0 ; i < resp.data.length ; i++){
                                let timeStr = String(resp.data[i].commentTime)
                                let time = timeStr.split("T")[0]+" "+timeStr.split("T")[1].split(":")[0]+":"+timeStr.split("T")[1].split(":")[1]
                                resp.data[i].commentTime = time
                                that.showCommentReply2.push(resp.data[i])
                            }
                            console.log(that.showCommentReply2)
                        })                       
                    },
                    //读取对应的回应内容
                    getReply2(commentId){
                        
                    },
                    //获得评论回复2.0
                    getCommentReply1(commentReplyId){
                        this.showCommentReply1 = []
                        var that = this
                        axios({
                            method:"get",
                            url:"http://localhost:8080/commentReply/getCommentReplyBig/"+commentReplyId
                        }).then(function(resp){
                            for(let i = 0 ; i < resp.data.length ; i++){
                                let timeStr = String(resp.data[i].commentTime)
                                let time = timeStr.split("T")[0]+" "+timeStr.split("T")[1].split(":")[0]+":"+timeStr.split("T")[1].split(":")[1]
                                resp.data[i].commentTime = time
                                that.showCommentReply1.push(resp.data[i])
                                
                                that.getReply2(resp.data[i].commentReplyId)
                            }
                            
                        })
                    },
                    //读取评论回复
                    getCommentReply(commentId){
                        this.showCommentReply = []
                        var that = this
                        axios({
                            method:"get",
                            url:"http://localhost:8080/commentReply/getCommentReplyBig/"+commentId
                        }).then(function(resp){
                            for(let i = 0;i < resp.data.length; i++){
                                let timeStr = String(resp.data[i].commentTime)
                                let time = timeStr.split("T")[0]+" "+timeStr.split("T")[1].split(":")[0]+":"+timeStr.split("T")[1].split(":")[1]
                                resp.data[i].commentTime = time
                                that.showCommentReply.push(resp.data[i])
                                that.getCommentReply1(resp.data[i].commentReplyId)
                            }
                            
                        })
                    },
                    //评论回复(内容)(楼主)
                    commentReply(text){
                        var that = this
                        that.commentEplyOnly()
                        //评论用户
                        that.commentEplyMongoDB.user2 = this.admin.userId
                        that.commentEplyMongoDB.user2UserName = this.admin.userNickName
                        that.commentEplyMongoDB.commentText = text
                        that.commentEplyMongoDB.user2Photo = this.admin.userPhoto
                        console.log(this.commentEplyMongoDB)
                        let commentEplyMongoDB = this.commentEplyMongoDB
                        axios({
                            method:"post",
                            url:"http://localhost:8080/commentReply/saveCommentReply",
                            data:{
                                "commentEplyMongoDB":commentEplyMongoDB
                            }
                        }).then(function(resp){
                            if(resp.data === "操作成功"){
                                //发送websocket
                                console.log(that.commentEplyMongoDB.user1)//接收方
                                console.log(that.commentEplyMongoDB.user2)//发送方
                                // axios({
                                //     method:"get",
                                //     url:"http://localhost:8080/commentReply/saveRabbitCommentReply/"+that.commentEplyMongoDB.user1+"/"+that.commentEplyMongoDB.user2+"/"+that.commentEplyMongoDB.commentText,
                                // })
                                var url = decodeURI(window.location.href);
                                let str = url.split("?")[1].split("&")
                                let phone = str[0].split("=")[1]
                                let hotelId = str[1].split("=")[1]
                                that.selectAllComment(hotelId)
                                that.getCommentReply(that.commentEplyMongoDB.user1commentReplyId)
                            }
                        })
                    },
                    //评论回复2.0
                    commentReply1(text){
                        console.log("即使更新")
                        console.log("回复内容-->"+text)
                        var that = this
                        that.commentEplyOnly()
                        this.commentEplyMongoDB.commentText = text
                        console.log(this.admin)
                        this.commentEplyMongoDB.user2Photo = this.admin.userPhoto
                        console.log(this.commentEplyMongoDB)
                        var that = this
                        axios({
                            method:"post",
                            url:"http://localhost:8080/commentReply/saveCommentReply",
                            data:{
                                "commentEplyMongoDB":this.commentEplyMongoDB
                            }
                        }).then(function(resp){
                            if(resp.data === "操作成功"){
                                console.log(that.commentEplyMongoDB)
                                var url = decodeURI(window.location.href);
                                console.log(url)
                                let str = url.split("?")[1].split("&")
                                let phone = str[0].split("=")[1]
                                let hotelId = str[1].split("=")[1]
                                that.selectAllComment(hotelId)
                                that.getCommentReply1(that.commentEplyMongoDB.user1commentReplyId)
                            }
                        })
                    },
                    //收起评论(回复)
                    commentShowLess1(){
                        console.log("评论收起2.0")
                        var that = this
                        that.max1 = 5
                    },
                    //展示更多评论(回复)
                    commentShowMore1(){
                        console.log("评论展示2.0")
                        var that = this
                        that.max1 = this.max + 5
                    },
                    //收起评论
                    commentShowLess(){
                        console.log("收起评论")
                        var that = this
                        that.max = 5
                    },
                    //展示更多评论
                    commentShowMore(){
                        console.log("展开评论")
                        var that = this
                        that.max = this.max + 5
                    },
                    //评论回复框保持唯一(设置所有评论回复框状态为none)
                    commentEplyOnly(){
                        var that = this
                        console.log(this.hotel_id)
                        for(let i = 0; i < this.commentReplyBoxList.length; i++){
                            $("."+this.commentReplyBoxList[i]).css("display","none") 
                        }
                    },
                    //评论回复边框(样式)
                    commentEply(comment){
                        console.log("点击回复框")
                        //判断登录状态
                        if(this.admin.token == undefined){
                            alert("请先登录")
                            window.location.href = "../../admin/admin.html"
                        }
                        console.log(comment)
                        //封装被评论->评论id 被评论用户id 被评论用户名
                        this.commentEplyMongoDB.user1commentReplyId = comment.commentId
                        this.commentEplyMongoDB.user1 = comment.userId
                        this.commentEplyMongoDB.user1UserName = comment.userName
                        this.commentEplyMongoDB.mainComment = comment.commentId
                        let commentId = comment.commentId
                        var that = this
                        let displayStr = $("."+commentId).css("display")
                        //已经有其他回复框打开
                        if(this.commentReplyBoxList.length > 0)
                            that.commentEplyOnly()
                        if(displayStr === "none"){
                            this.textarea2 = ""
                            $("."+commentId).css("display","block")  
                            that.oneReplyBox = this.oneReplyBox + 1
                            that.commentReplyBoxList.push(commentId)
                        }else{
                            this.textarea2 = ""
                            $("."+commentId).css("display","none")
                            that.oneReplyBox = this.oneReplyBox - 1
                            that.commentReplyBoxList.pop(commentId)
                        }
                    },
                    //评论回复边框(样式)2.0
                    commentEply1(comment){
                        console.log("点击回复框2.0")
                        if(this.admin.token == undefined){
                            alert("请先登录")
                            window.location.href = "../../admin/admin.html"
                        }
                        console.log(comment)
                        //封装被评论->评论id 被评论用户id 被评论用户名 (评论者被回复-->评论者变被评论者)
                        //评论被回复id
                        this.commentEplyMongoDB.user1commentReplyId = comment.commentReplyId
                        this.commentEplyMongoDB.user1 = comment.user2
                        this.commentEplyMongoDB.user1UserName = comment.user2UserName
                        this.commentEplyMongoDB.user2Photo = this.admin.userPhoto
                        this.commentEplyMongoDB.mainComment = comment.mainComment
                        let commentId = comment.commentReplyId
                        var that = this
                        let displayStr = $("."+commentId).css("display")
                        // console.log(commentId)
                        // console.log(displayStr)
                        //读取当前登录用户的信息
                        this.commentEplyMongoDB.user2 = String(this.admin.userId)
                        this.commentEplyMongoDB.user2UserName = this.admin.userNickName
                        if(this.commentReplyBoxList.length > 0)
                            that.commentEplyOnly()
                        if(displayStr === "none"){
                            this.textarea2 = ""
                            $("."+commentId).css("display","block")  
                            that.oneReplyBox = this.oneReplyBox + 1
                            that.commentReplyBoxList.push(commentId)
                        }else{
                            this.textarea2 = ""
                            $("."+commentId).css("display","none")
                            that.oneReplyBox = this.oneReplyBox - 1
                            that.commentReplyBoxList.pop(commentId)
                        }
                    },
                    //查询出所有评论内容
                    selectAllComment(hotelId){
                        var userId = (this.admin.userId);
                        this.userId = userId
                        var that = this;
                        //即时更新所有评论回复信息
                        that.selectUpdateAllReplyComment()
                        that.commentsList = []
                        var timer =null
                        let num = 0
                        clearTimeout(this.timer);  //清除延迟执行
                        axios({
                            method:"GET",
                            url:"http://localhost:8080/room/getCommentByHotelId/"+hotelId
                        }).then(function(resp){
                            console.log(resp.data.data)
                            let commentsList = resp.data.data
                            for(let i = 0 ; i < commentsList.length ; i++){
                                let commentId = commentsList[i].id
                                //读取该评论所有回复
                                that.getCommentReply(commentId)
                                let text = commentsList[i].text
                                let images = commentsList[i].images
                                let commentTimeStr = String(commentsList[i].commentTime)
                                //对评论时间进行处理
                                let commentTime = commentTimeStr.split("T")[0]+" "+commentTimeStr.split("T")[1].split(":")[0]+":"+commentTimeStr.split("T")[1].split(":")[1]
                                let userName = commentsList[i].userName
                                let userId = commentsList[i].userId
                                let orderId = commentsList[i].orderId
                                let score = commentsList[i].score
                                let userPhoto = commentsList[i].userPhoto
                                if(score == null)
                                    score = 0
                                let obj = new Object();
                                obj.userId = userId
                                obj.commentId = commentId
                                obj.text = text
                                obj.images = images
                                obj.commentTime = commentTime
                                obj.userName = userName
                                obj.orderId = orderId
                                obj.kudosNum = 0
                                obj.hasKudos = false
                                obj.score = score
                                obj.userPhoto = userPhoto
                                axios({
                                    method:"GET",
                                    url:"http://localhost:8080/kudos/ifCommentHasKudos/"+obj.orderId+"/"+that.admin.userId,
                                }).then(function(resp){
                                    obj.hasKudos = resp.data
                                    console.log("查询是否点赞"+obj.hasKudos)
                                })
                                axios({
                                    method:"GET",
                                    url:"http://localhost:8080/kudos/getKudosNum/"+obj.orderId,
                                }).then(function(resp){
                                    obj.kudosNum = "" + resp.data
                                })
                                obj.score = Number(score)
                                num = num+obj.score;
                                
 
                                this.timer = setTimeout(()=>{
                                    that.commentsList.push(obj)
                                },300);
                                
                                
                            }
                            that.selectScore(num,commentsList.length)
                            
                        })
                    },
                    //获取酒店评分
                    selectScore(num,len){
                        if(num == 0)
                            this.hotelScore = 0
                        else
                            this.hotelScore = (num/len).toFixed(1)

                    },

                    selectUpdateAllReplyComment(){
                        axios({
                            method:"GET",
                            url:"http://localhost:8080/commentReply/updateRabbitCommentReply"
                        })
                    },
                    //查询当前查看酒店的用户有没有收藏过该酒店
                    collectionRedisSelect(hotelId,userId){
                        var that = this
                        //获取当前页面酒店id
                        // console.log("当前酒店id:"+hotelId)
                        // console.log("当前正在查看的用户id:"+userId)
                        //redis查询出当前用户是否收藏此页面
                        axios({
                            methods:"GET",
                            url:"http://localhost:8080/collection/redis/selectById/"+userId+"/"+hotelId,
                        }).then(function(resp){
                            this.isCollection = resp.data
                            //this.isCollection为boolean类型,代表用户是否已经进行过点赞操作
                            if(this.isCollection){
                                //如果已经点赞-->点赞图标变绿色
                                that.count1 = 1
                            }else{
                                that.count1 = 0
                            }
                        })
                    },
                    //根据日期进行查询剩余房间数量
                    getDate(hotelId){
                        var that = this
                        window.localStorage.setItem("isLoad",1)
                        //1.获取日期
                        console.log("开始日期:"+this.mydate[0])
                        console.log("结束日期:"+this.mydate[1])

                        //杨正航所需日期
                        window.localStorage.setItem("start_date",this.mydate[0]);
                        window.localStorage.setItem("end_date",this.mydate[1]);
                        //2.发送请求给后端
                        axios({
                            method:"GET",
                            url:"http://localhost:8080/room/getRooms/"+this.mydate[0]+"/"+this.mydate[1]+"/"+hotelId,
                        }).then(function(resp){
                            that.hotel_information = []
                            console.log(resp.data)
                            for(var key in resp.data){
                                console.log(key + "=" + resp.data[key])
                                //查询单个类型房间信息
                                axios({
                                method:"GET",
                                url:"http://localhost:8080/room/getRoomListByRoomTypeId/"+key+"/"+resp.data[key],
                            }).then(function(resp){
                                console.log("查询成功...")
                                console.log(resp.data)
                                that.hotel_information.push(resp.data)
                            })
                            }
                        })
                    },
                    //所有评论js效果
                    clickComments(){
                        if(this.count2 == 0){
                            $(".user-comment-2-1-a").css("background-color","#4db46a")
                            $(".user-comment-2-1-a").css("color","white")
                            this.count2 = 1
                            return;
                        }
                        if(this.count2 == 1){
                            $(".user-comment-2-1-a").css("background-color","#efefef")
                            $(".user-comment-2-1-a").css("color","#383838")
                            this.count2 = 0
                            return;
                        }
                    },
                    //收藏js效果
                    clickCollection(){
                        if(this.admin.token == null){
                            alert("请先登录")
                            window.location.href = "../../admin/admin.html"
                        }
                        var that = this
                        //用户没有收藏
                        console.log(this.user_id)
                        if(this.count1 == 0){
                            //redis进行添加,代表该用户已经收藏
                            axios({
                                methods:"GET",
                                url:"http://localhost:8080/collection/redis/insertUserId/"+this.user_id+"/"+this.hotel_id
                            }).then(function(resp){
                                //this.isCollection为boolean类型,代表用户是否已经进行过点赞操作
                                this.isCollection = resp.data
                                if(this.isCollection){
                                    $(".comment-img").css("background","url(images/collection-14px-green.svg)")
                                    $(".comment a").css("border","1px solid #4db46a")
                                    that.count1 = 1;
                                }
                            })
                            return;
                        }
                        //用户已经收藏
                        if(this.count1 == 1){
                            //redis进行删除,代表用户取消收藏
                            axios({
                                methods:"GET",
                                url:"http://localhost:8080/collection/redis/removeUserId/"+this.user_id+"/"+this.hotel_id
                            }).then(function(resp){
                                this.isCollection = resp.data
                                if(this.isCollection){
                                    $(".comment-img").css("background","url(images/collection-14px.svg)")
                                    $(".comment a").css("border","1px solid #efefef")
                                    that.count1 = 0;
                                }
                            })
                            return;
                        }
                    },
                    //查询当前酒店所有房间
                    selectAllRoom(hotelId){
                        var that = this
                        axios({
                            method:"get",
                            url:"http://localhost:8080/room/getRooms/"+hotelId,
                        }).then(function(resp){
                            for(let i = 0; i < resp.data.length; i++){
                                // console.log(resp.data[i])
                                that.hotel_information.push(resp.data[i])
                            }
                        })
                    },
                    // 是否关闭城市选项
                    closeCity() {
                        if (this.isShowForm) {
                            this.isShowForm = false;
                            this.monitor = window.pageYOffset;
                            console.log(this.monitor)
                        } else {
                            this.isShowForm = true;
                        }
                    },
                    //查询酒店信息
                    selectHotel(hotelId){
                        var that = this
                        axios({
                            method:"GET",
                            url:"http://localhost:8080/hotelInfo/"+hotelId,
                        }).then(function(resp){
                            that.hotel_info = resp.data
                        })
                    },
                    // 预定
                    orderBtn(room,i) {
                        console.log(room)
                        var contain;
                        switch(room.roomType){
                            case "单人间":
                                contain = 1;
                            case "标准间":
                                contain = 2;
                        }
                        console.log(contain)
                        console.log(room)
                        
                        window.localStorage.setItem("hotelId",this.hotel_id)
                        window.localStorage.setItem("hotelName",this.hotel_info.hotelName)
                        console.log(this.hotel_id)
                        window.localStorage.setItem("room_Type",room.roomTypeId)
                        window.localStorage.setItem("room_Typename",room.roomType)
                        window.localStorage.setItem("room_contain_num",room.standby01)
                        window.localStorage.setItem("roomLeastPrice",room.roomLeastPrice)
                        location.href="../../order/order_writeinfo.html?phone="+this.phone

                    },
                    // 是否关闭悬浮搜选框城市选项
                    closeCity2() {
                        if (this.isShowFormXF) this.isShowFormXF = false;
                        else this.isShowFormXF = true;
                    },
                    // 选择城市
                    selectCity(e) {
                        this.city = e.currentTarget.innerHTML
                    },
                    // 搜索按钮
                    searchBtn() {
                    },
                    // 收藏
                    collection() {
                        if (this.isCollection) this.isCollection = false
                        else this.isCollection = true
                        // 将收藏的数据记录传递给个人中心
                    },
                    //点赞
                    kudos(i){
                        var that = this
                        if(this.commentsList[i].hasKudos == false){
                            //用户未点赞 执行点赞业务
                            axios({
                                method:"GET",
                                url:"http://localhost:8080/kudos/doKudos/"+that.commentsList[i].orderId+"/"+that.userId,
                            }).then(function(resp){
                                if(resp.status==200){
                                    console.log("成功点赞")
                                    axios({
                                        method:"GET",
                                        url:"http://localhost:8080/kudos/ifCommentHasKudos/"+that.commentsList[i].orderId+"/"+that.userId,
                                    }).then(function(resp){
                                        that.commentsList[i].hasKudos = resp.data
                                        console.log("查询是否点赞"+that.commentsList[i].hasKudos)
                                    })
                                    axios({
                                        method:"GET",
                                        url:"http://localhost:8080/kudos/getKudosNum/"+that.commentsList[i].orderId,
                                    }).then(function(resp){
                                        console.log("查询当前点赞数: "+resp.data)
                                        that.commentsList[i].kudosNum = resp.data
                                    })
                                    // that.commentsList[i].hasKudos = true
                                }
                            })
                        } else{
                            //用户已点赞 执行取消点赞业务
                            axios({
                                method:"GET",
                                url:"http://localhost:8080/kudos/undoKudos/"+that.commentsList[i].orderId+"/"+that.userId,
                            }).then(function(resp){
                                if(resp.status==200){
                                    console.log("取消点赞")
                                    axios({
                                        method:"GET",
                                        url:"http://localhost:8080/kudos/ifCommentHasKudos/"+that.commentsList[i].orderId+"/"+that.userId,
                                    }).then(function(resp){
                                        that.commentsList[i].hasKudos = resp.data
                                        console.log("查询是否点赞"+that.commentsList[i].hasKudos)
                                    })
                                    axios({
                                        method:"GET",
                                        url:"http://localhost:8080/kudos/getKudosNum/"+that.commentsList[i].orderId,
                                    }).then(function(resp){
                                        console.log("查询当前点赞数: "+resp.data)
                                        that.commentsList[i].kudosNum = resp.data
                                    })
                                    // that.commentsList[i].hasKudos = false
                                }
                            })
                        }
                        // var timer =null
                        // clearTimeout(this.timer);  //清除延迟执行
 
                        // this.timer = setTimeout(()=>{
                        //     axios({
                        //         method:"GET",
                        //         url:"http://localhost:8080/kudos/getKudosNum/"+this.commentsList[i].orderId,
                        //     }).then(function(resp){
                        //         console.log("查询当前点赞数: "+resp.data)
                        //         that.commentsList[i].kudosNum = resp.data
                        //     })
                        // },300);

                    },
                    //判断用户是否登录(解决收藏未登录状态bug)
                    selectUser(){
                        if(this.admin.token == undefined){
                            console.log("正在执行新的函数")
                            $(".comment-img").css("background","url(images/collection-14px.svg)")
                            $(".comment a").css("border","1px solid #efefef")
                        }
                    },
                    // <!-- websocket提醒用户优惠劵将要过期 -->
                    selectCouponWebSocket() {  
                        var ws;
                        var that = this;
                        let userId = this.admin.userId
                        let token = this.admin.token
                        //检测浏览器是否支持webSocket
                        if ("WebSocket" in window) {
                            console.log("您的浏览器支持webSocket!");
                            //模拟产生clientID
                            let clientID = Math.ceil(Math.random() * 100);
                            //创建 WebSocket 对象,注意请求路径！！！！
                            ws = new WebSocket("ws://localhost:8080/testWebSocket/" + userId);

                            //与服务端建立连接时触发
                            ws.onopen = function () {
                                console.log("<p>与服务端建立连接建立成功！您的客户端ID=" + userId + "</p>");
                                console.log(token)
                            }

                            //接收到服务端消息时触发
                            ws.onmessage = function (evt) {
                                let received_msg = evt.data;
                                console.log("客户端收到消息:" + received_msg)
                                if (received_msg) {
                                    console.log(received_msg)
                                    let message = received_msg.split("-")[0]
                                    console.log(message)
                                    //被回复的用户
                                    let userIdNew = Number(received_msg.split("-")[1]) 
                                    console.log(userIdNew)
                                    console.log(userId)
                                    if(userId == userIdNew){
                                        console.log("即时发送websocket...")
                                        that.couponWebsocketMsg = message
                                        //(嵇灏 user2-->user1) 
                                        that.open2()
                                        console.log(this.couponWebsocketMsg)
                                    }else{
                                        console.log("用户未登录，存入redis")
                                        //发送请求将消息存入redis当中
                                        console.log(userIdNew)
                                        console.log(message)
                                        axios({
                                            method:"POST",
                                            data:{
                                                "userId":JSON.stringify(userIdNew),
                                                "message":JSON.stringify(message)
                                            },
                                            url:"http://localhost:8080/customerUserCoupon/saveWebSocketRedis",   
                                        }).then(function(resp){
                                            console.log(resp.data)
                                        })
                                    }
                                } else {
                                    console.log("不存在返回信息")
                                }
                            };

                            //服务端关闭连接时触发
                            ws.onclose = function () {
                                console.error("连接已经关闭.....")
                            };
                            
                        } else {
                            console.log("您的浏览器不支持webSocket！");
                        }
                    },
                    //获取存储在redis当中的websocket未读取信息 重新加载到websocket进行推送
                    getRedisWebSocket(){
                        var that = this
                        console.log("redis读取重新进入websocket")
                        console.log(this.admin.userId)
                        axios({
                            method:"GET",
                            url:"http://localhost:8080/customerUserCoupon/getRedisToWebSocket/"+this.admin.userId
                        }).then(function(resp){
                            that.selectCouponWebSocket()
                        })
                    },
                    // 推荐酒店
                    getRecommendHotel() {
                        var that = this
                        axios({
                            method: 'get',
                            url: 'http://localhost:8080/recommendHotelByHotelId' + "?userId=" + that.admin.userId +
                                "&hotelId=" + that.hotel_id + "&howMany=" + 5
                        }).then(function (resp) {
                            console.log(resp)
                            var array = []
                            // 酒店Id相同的就不推荐
                            for(let i = 0;i < resp.data.data.length;i++) {
                                if (resp.data.data[i].hotelId != that.hotel_id) array.push(resp.data.data[i])
                            }
                            // 展示推荐框
                            if (array.length != 0) that.isShowRecommendHotelList = true
                            console.log("推荐酒店:"+array)
                            that.recommendHotelList = array
                        })
                    },
                    
                },
                
                beforeDestroy() {
                    //关闭多余websocket
                },

                // 钩子函数
                created() {
                    var that = this;
                    // 取出缓存中的用户数据
                    var url = decodeURI(window.location.href);
                    console.log(url)
                    let str = url.split("?")[1].split("&")
                    console.log(str.length)
                    //登录状态
                    if(str.length == 2){
                        console.log("登录状态...")
                        let phone = str[0].split("=")[1]
                        that.phone = phone
                        let hotelId = str[1].split("=")[1]
                        console.log("本地缓存:"+JSON.parse(window.localStorage.getItem(phone)))
                        that.admin = JSON.parse(localStorage.getItem(phone))
                        that.hotel_id = hotelId
                        console.log(this.admin)
                        console.log(this.hotel_id)
                        that.user_id = this.admin.userId
                    }else{
                        console.log("未登录状态...")
                        let hotelId = str[0].split("=")[1]
                        that.hotel_id = hotelId
                        console.log(this.hotel_id)
                    }
                    
                },
            //页面初始化之后执行查询操作获取json数据
            mounted() {
                var that = this
                //判断用户是否已经登录
                that.selectUser()
                that.getRedisWebSocket()//获取存储在redis当中的websocket未读取信息
                //查询当前酒店房间
                console.log("酒店id: "+this.hotel_id)
                that.selectAllRoom(this.hotel_id)
                //获取酒店信息
                that.selectHotel(this.hotel_id)
                //展示所有评论
                that.selectAllComment(this.hotel_id)
                if(this.admin.token != undefined){
                    console.log(this.admin)
                    that.aHref += this.admin.userPhone
                    that.aHref1 += this.admin.userPhone
                    //判断用户是否收藏
                    that.collectionRedisSelect(this.hotel_id,this.user_id)
                    // <!-- websocket -->
                    that.selectCouponWebSocket();
                }
                let myDate = new Date();
                let startDate = myDate.toISOString().slice(0, 10)
                myDate.setDate(myDate.getDate() + 1);
                let endDate = myDate.toISOString().slice(0, 10)

                window.localStorage.setItem("start_date",startDate);
                window.localStorage.setItem("end_date",endDate);
                
                // 调用推荐算法
                that.getRecommendHotel();
            }, 
            })
    </script>
</body>

</html>